/*
 * local parser turns local variable dclaration into real local variable and assign init value
 *
 * local parser is very simiar to parser in parse.h
 */

#ifndef _CUSTOM_H
#define _CUSTOM_H
#include "token.h"
#include "parse.h"
#include <vector>
#include <string>
#include <sstream>
// local variable can only be a number, so they don't have type attri
class local_parser {
private:
    int current;
    std::string input;
    std::vector<variable> variables;

    bool isEnd();
    char advance();
    char peek();
    void parse_one_variable();
    std::string take_varname();
    std::string residu();
    int take_number();
public:
    local_parser(std::string input);
    void local_parse();
    std::vector<variable> get_variables();
};
std::vector<variable> local_parse(std::string input);
#endif
